RewriteEngine On
RewriteBase /<?php echo ($this->siteDir) ? $this->siteDir . "/\n" : "\n"; ?>
RewriteRule ^\.htaccess$ - [F]
<?php echo (false !== $this->additionalRules) ? $this->additionalRules . "\n" : ''; ?>
#canonicalization do not remove!
#{%canonic_rules%}
#end canonicalization
RewriteRule ^index\.html$ <?php echo $this->websiteUrl . " [R=permanent,L] \n"; ?>
#301 redirect
<?php if(!empty ($this->redirectTable)): ?>
<?php foreach ($this->redirectTable as $redirect => $data){
if(strstr($data['currUrl'], "http://")!=false){ ?>
RewriteRule ^<?php echo str_replace('\\\\', '',urldecode($data['oldUrl'])); ?>$ <?php echo urldecode($data['currUrl']); ?> [R=permanent,L]
<?php }else{ ?>
RewriteRule ^<?php echo str_replace('\\\\', '',urldecode($data['oldUrl'])); ?>$ <?php echo $this->websiteUrl .urldecode($data['currUrl']); ?>.html [R=permanent,L]
<?php }	?>
<?php } ?>
<?php endif; ?>
#end 301
RewriteCond %{REQUEST_URI} =""
RewriteRule ^.*$ public/index.php [NC,L]
RewriteCond %{REQUEST_URI} !^/<?php echo ($this->siteDir) ? $this->siteDir . '/' : '' ;?>public/.*$
RewriteRule ^(.*)$ public/$1
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^.*$ - [NC,L]
RewriteRule ^public/.*$ public/index.php [NC,L]